﻿#region Using Directives

    using System;

    using MarketPulse.BusinessLogic.Common;

#endregion

namespace MarketPulse.BusinessLogic.Private.StateMachine
{
    [Serializable]
    internal class AssignmentStateQAApproved : AssignmentStateBase
    {
        internal AssignmentStateQAApproved(bool throwIfInvalid) : base(throwIfInvalid)
        {
            mAssignmentStateType = AssignmentStatusTypeList.QAApproved;
            InitAssignmentStateString();
        }

        public override bool MarkReadyForTransfer(IAssignmentStateContext state, bool tryTransition)
        {
            if (!tryTransition)
            {
                state.SetState(new AssignmentStateReadyForTransfer(mThrowIfInvalid));
            }
            return true;
        }

        public override bool QAStartDataEntry(IAssignmentStateContext context, bool tryTransition)
        {
            if (!tryTransition)
            {
                context.SetState(new AssignmentStateQAInProgress(mThrowIfInvalid));
            }
            return true;
        }
    }
}
